package com.qtyx.nms.ui.adapter

import android.content.Context
import android.graphics.Color
import android.widget.LinearLayout
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.ldd.base.ui.adapter.BaseRVAdapter
import com.ldd.base.ui.adapter.BaseRVVH
import com.qtyx.nms.R
import com.qtyx.nms.mvp.model.bean.MessageBean
import com.qtyx.nms.mvp.model.bean.NurseBean
import com.qtyx.nms.ui.activity.HomePageActivity
import com.qtyx.nms.util.DisplayUtil


/**
 * 医师适配器
 */
class YiShiAdapter(mContext: Context, list: List<NurseBean.Data>) :BaseRVAdapter<NurseBean.Data>(mContext, list) {
    override fun getLayoutId(viewType: Int)= R.layout.item_yishi

    override fun convert(vh: BaseRVVH, position: Int, data: NurseBean.Data) {
        val llMain=vh.getView<LinearLayout>(R.id.ll_item_homepage_yishi_main)
        val tvName=vh.getView<TextView>(R.id.tv_item_homepage_yishi_name)
        val tvPatientNum=vh.getView<TextView>(R.id.tv_item_homepage_yishi_patientNum)

        tvName.text=data.doctorName
        tvPatientNum.text="${data.sqlData.size}人"

        llMain.setOnClickListener {
            onItemClickListener?.onItemClick(position,data)
        }
    }

    var onItemClickListener: OnItemClickListener? = null

    interface OnItemClickListener {
        fun onItemClick(position: Int,data: NurseBean.Data)
    }
}